
package edu.wpi.first.wpilibj.templates.subsystems;

import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.can.CANTimeoutException;
import edu.wpi.first.wpilibj.templates.HardwareMap;

/**
 *
 */
public class Feeder extends Subsystem {
    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    CANJaguar Motor; 
    
    // Change polarity so that the motor moves the right direction
    // for a positive speed value.  Change to -1 for opposite effect.
    private static final int POLARITY = 1; 
    
    public Feeder(){
        super("Feeder"); 
        try {
            Motor = new CANJaguar(HardwareMap.FEEDER_JAGUAR);
        }
        catch (CANTimeoutException e){
            e.printStackTrace();
        }
    }
    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }
    public void Move(double Speed){
        try {
            Motor.setX(POLARITY*Speed);
        }
        catch (CANTimeoutException e){
            e.printStackTrace();
        }  
    }
}

